package com.dongzili.common.config.exception;

import com.dongzili.common.vo.ResponseCode;
import lombok.Getter;
import lombok.Setter;

import java.util.List;

@Setter
@Getter
public class BusinessExceptionHandler extends RuntimeException{

    private ResponseCode responseCode = ResponseCode.ERROR;
    private List<String> data;

    public BusinessExceptionHandler(String message) {
        super(message);
    }
    public BusinessExceptionHandler(ResponseCode code) {
        super(code.getMessage());
        this.responseCode = code;
    }
    public BusinessExceptionHandler(String message, List<String> data) {
        super(message);
        this.data = data;
    }
    public BusinessExceptionHandler(ResponseCode code, List<String> data) {
        super(code.getMessage());
        this.responseCode = code;
        this.data = data;
    }
    public BusinessExceptionHandler(ResponseCode code, String message) {
        super(code.getMessage()+" --> "+message);
        this.responseCode = code;
    }

}
